<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="checkuser.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>存款</title>
    <link href="style/bootstrap.min.css" rel="stylesheet">
	<style type="text/css">
    	body{
    		padding:70px;
    	}
    </style>
  </head>
  
  <body>
  	<div class="topbar" data-dropdown="dropdown">
		<div class="topbar-inner">
			<div class="container">
				<h3>
					<a href="#">ATM网上银行存款系统</a>
				</h3>
				<ul class="nav secondary-nav">
					<li class="dropdown">
						<a class="dropdown-toggle" href="#"><%=acc.getUsername() %></a>
						
					</li>
				</ul>
			</div>
		</div>
	</div>
    <form id="loginForm" action="user.jspx?task=save" method="post">
    	<div class="actions">
    		请输入金额：<input type="text" class="text" name="money"/>
    		<span class="help-inline">必须是大于0的纯数字</span>
    	</div>
    	<div class="actions">
    		<input id="loginBtn" class="btn large primary" type="button" value="保存"/>
    		<a class="btn success" href="main.jsp">返回</a>
    	</div>
    </form>	
  </body>
  <script type="text/javascript" src="script/jquery.js"></script>
  <script type="text/javascript">
  	$(document).ready(function(){
  		$("#loginBtn").click(function(){
  			var money = $("input[name='money']").val();
  			if(money == "") {
  				$("input[name='money']").next("span").remove();
  				$("input[name='money']").after("<span style='color:red'>金额不能为空</span>");
  				return;
  			}else if(!/^\d{1,}$/.test(money)){
  				$("input[name='money']").next("span").remove();
  				$("input[name='money']").after("<span style='color:red'>请输入正确的金额</span>");
  				return;
  			}
  			
  			$("#loginForm").submit();
  		});
  		
  		$(".text").click(function(){
  			$(this).next("span").remove();
  		});
  	});
  	
  </script>
</html>
